home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / Mesa-3.0 / SRC-GLU / TESS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-29  |  2.5 KB  |  113 lines

  1. /* $Id: tess.h,v 1.3 1997/10/29 02:02:20 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.3
  6.  * Copyright (C) 1995-1997  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: tess.h,v $
  26.  * Revision 1.3  1997/10/29 02:02:20  brianp
  27.  * various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver)
  28.  *
  29.  * Revision 1.2  1997/05/24 13:30:58  brianp
  30.  * added TESS_H multi-inclusion prevention test
  31.  *
  32.  * Revision 1.1  1996/09/27 01:19:39  brianp
  33.  * Initial revision
  34.  *
  35.  */
  36.  
  37.  
  38. /*
  39.  * This file is part of the polygon tesselation code contributed by
  40.  * Bogdan Sikorski
  41.  */
  42.  
  43.  
  44. #ifndef TESS_H
  45. #define TESS_H
  46.  
  47.  
  48. #include "gluP.h"
  49.  
  50. #define EPSILON 1e-06 /* epsilon for double precision compares */
  51.  
  52. typedef enum
  53. {
  54.     OXY,
  55.     OYZ,
  56.     OXZ
  57. } projection_type;
  58.  
  59. typedef struct callbacks_str
  60. {
  61.     void (CALLBACK *begin)( GLenum mode );
  62.     void (CALLBACK *edgeFlag)( GLboolean flag );
  63.     void (CALLBACK *vertex)( GLvoid *v );
  64.     void (CALLBACK *end)( void );
  65.     void (CALLBACK *error)( GLenum err );
  66. } tess_callbacks;
  67.  
  68. typedef struct vertex_str
  69. {
  70.     void                *data;
  71.     GLdouble            location[3];
  72.     GLdouble            x,y;
  73.     GLboolean            edge_flag;
  74.     struct vertex_str    *shadow_vertex;
  75.     struct vertex_str    *next,*previous;
  76. } tess_vertex;
  77.  
  78. typedef struct contour_str
  79. {
  80.     GLenum                type;
  81.     GLuint                vertex_cnt;
  82.     GLdouble            area;
  83.     GLenum                orientation;
  84.     struct vertex_str    *vertices,*last_vertex;
  85.     struct contour_str    *next,*previous;
  86. } tess_contour;
  87.  
  88. typedef struct polygon_str
  89. {
  90.     GLuint                vertex_cnt;
  91.     GLdouble            A,B,C,D;
  92.     GLdouble            area;
  93.     GLenum                orientation;
  94.     struct vertex_str    *vertices,*last_vertex;
  95. } tess_polygon;
  96.  
  97. struct GLUtriangulatorObj
  98. {
  99.     tess_contour        *contours,*last_contour;
  100.     GLuint                contour_cnt;
  101.     tess_callbacks        callbacks;
  102.     tess_polygon        *current_polygon;
  103.     GLenum                error;
  104.     GLdouble            A,B,C,D;
  105.     projection_type        projection;
  106. };
  107.  
  108.  
  109. extern void tess_call_user_error(GLUtriangulatorObj *,GLenum);
  110.  
  111.  
  112. #endif
  113.